home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Development Libraries / SGI IRIX 6.2 Development Libraries.iso / dist / gl_dev.idb / usr / include / GL / glr.h.z / glr.h
Encoding:
C/C++ Source or Header  |  1996-03-15  |  8.1 KB  |  159 lines

  1. #ifndef __glr_h__
  2. #define __glr_h__
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. /* Copyright 1995, Silicon Graphics, Inc. All Rights Reserved.
  9.  
  10.    This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.; the 
  11.    contents of this file may not be disclosed to third parties, copied or
  12.    duplicated in any form, in whole or in part, without the prior written
  13.    permission of Silicon Graphics, Inc.
  14.  
  15.    RESTRICTED RIGHTS LEGEND: Use, duplication or disclosure by the Government 
  16.    is subject to restrictions as set forth in subdivision (c)(1)(ii) of the
  17.    Rights in Technical Data and Computer Software clause at DFARS
  18.    252.227-7013, and/or in similar or successor clauses in the FAR, DOD or
  19.    NASA FAR Supplement. Unpublished - rights reserved under the Copyright
  20.    Laws of the United States. */
  21.  
  22. /* OpenGL Remote rendering API (GLR) interface */
  23.  
  24. /* These values should exactly match the GLX protocol values for the
  25.    attribute values for glXGetConfig.  Note that because the GLR API is
  26.    independent of the GLX API, we avoid including <GL/glxtokens.h> to obtain
  27.    the values. */
  28.  
  29. #define GLR_BUFFER_SIZE         2  /* depth of the color buffer  */
  30. #define GLR_LEVEL               3  /* level in plane stacking */
  31. #define GLR_RGBA                4  /* true if RGBA mode */
  32. #define GLR_DOUBLEBUFFER        5  /* double buffering supported */
  33. #define GLR_STEREO              6  /* stereo buffering supported */
  34. #define GLR_AUX_BUFFERS         7  /* number of aux buffers */
  35. #define GLR_RED_SIZE            8  /* number of red component bits */
  36. #define GLR_GREEN_SIZE          9  /* number of green component  bits */
  37. #define GLR_BLUE_SIZE           10  /* number of blue component  bits */
  38. #define GLR_ALPHA_SIZE          11  /* number of alpha component bits */
  39. #define GLR_DEPTH_SIZE          12  /* number of depth bits */
  40. #define GLR_STENCIL_SIZE        13  /* number of stencil bits */
  41. #define GLR_ACCUM_RED_SIZE      14  /* number of red accum bits  */
  42. #define GLR_ACCUM_GREEN_SIZE    15  /* number of green accum bits */
  43. #define GLR_ACCUM_BLUE_SIZE     16  /* number of blue accum bits */
  44. #define GLR_ACCUM_ALPHA_SIZE    17  /* number of alpha accum bits */
  45. #define GLR_SAMPLES_SGIS        100000  /* number of samples per pixel */
  46. #define GLR_SAMPLE_BUFFER_SGIS  100001  /* the number of multisample buffers */
  47. #define GLR_SCREEN_HINT         808080  /* hint for screen assignment */
  48.  
  49. typedef struct _GLrSession *GLrSession;
  50. typedef struct _GLrCanvasType *GLrCanvasType;
  51. typedef struct _GLrCanvas *GLrCanvas;
  52.  
  53. /* glrOpenSession - open a connection to GLR rendering server.  Returns NULL
  54.    if the session could not be established.  If hostname is NULL, the
  55.    GLR_SERVER environment variable is used.  If GLR_SERVER is not set or the
  56.    empty string ("") is passed for hostname, glrOpenSession tries to find a
  57.    GLR server on the local machine. */
  58. extern GLrSession glrOpenSession (char *hostname);
  59.  
  60. /* glrCloseSession - close an open GLR rendering server created by
  61.    glrOpenSession. Any allocate GLrCanvasType and/or GLrCanvas objects are
  62.    automatically freed and/or destroyed. */
  63. extern void glrCloseSession (GLrSession session);
  64.  
  65. /* glrGetCanvasType - obtain a canvas type by supplying a zero terminated
  66.    list of GLR attributes.  The semantics are the same as those for
  67.    glXChooseVisual. For a multi-headed GLR server, a canvas type does not
  68.    determine a particular screen.   NULL is returned if the described canvas
  69.    type is not supported.  */
  70. extern GLrCanvasType glrGetCanvasType (GLrSession session, int *attribList);
  71.  
  72. /* glrFreeCanvasType - free a canvas type allocated with glrGetCanvasType.  */
  73. extern void glrFreeCanvasType (GLrCanvasType canvasType);
  74.  
  75. /* glrGetTimeoutLimit - return the server-wide timeout ceiling for rendering
  76.    interval (in milliseconds).  The interval is determine by the system
  77.    manager. */
  78. extern int glrGetTimeoutLimit (GLrSession session);
  79.  
  80. /* glrCreateCanvas - create a canvas with the same attributes as the
  81.    GLrCanvasType parameter.  The newly created canvas will share displays
  82.    lists (only within the same address space) with the canvas specied by
  83.    shareList. */
  84. extern GLrCanvas glrCreateCanvas (GLrCanvasType canvasType, GLrCanvas shareList);
  85.  
  86. /* glrGetMaxCanvasHeight - returns the maximum canvas height in pixels.
  87.    Potentially, different canvases (for example on different screens) may
  88.    have different heights.  You are guaranteed to be able to initiate a
  89.    rendering inteval witht the specified height in pixels.  If you choose a
  90.    larger value, you will be silently truncated to the maximum height. */
  91. extern int glrGetMaxCanvasHeight (GLrCanvas canvas);
  92.  
  93. /* glrGetMaxCanvasWidth - returns the maximum canvas width in pixels.
  94.    Potentially, different canvases (for example on different screens) may
  95.    have different widths.  You are guaranteed to be able to initiate a
  96.    rendering inteval witht the specified width in pixels.  If you choose a
  97.    larger value, you will be silently truncated to the maximum width. */
  98. extern int glrGetMaxCanvasWidth (GLrCanvas canvas);
  99.  
  100. /* glrDestroyCanvas - destroys the specified canvas.  */
  101. extern void glrDestroyCanvas (GLrCanvas canvas);
  102.  
  103. /* glrEstablishRenderState - "makes current" to the specified canvas so OpenGL
  104.    routines can be called to initialize the OpenGL state machine, but without 
  105.    a frame buffer.  This can be used outside a rendering interval to
  106.    initialize displays, texture objects, etc. outside of a rendering interval 
  107.    so frame buffer resource do not have to be instatiated.  A return value of 
  108.    1 indicates success, 0 indicates failure. */
  109. extern int glrEstablishRenderState (GLrCanvas canvas);
  110.  
  111. /* glrBeginRenderInterval - "makes current" to the specified canvas of the
  112.    specified width and height in pixels.  OpenGL routines can be called and a 
  113.    frame buffer is instantiated.  The timeout specifies the number of
  114.    milliseconds the canvas frame buffer is guaranteed to be available
  115.    (limited by the server timeout ceiling).  After the timeout expires, the
  116.    GLR server may (if other clients need the resources invalidate the canvas
  117.    frame buffer.  Once invalidated, the affect of OpenGL frame buffer 
  118.    operations is undefined.  The wait parameter specifies how long in
  119.    milliseconds that glrBeginRenderInterval will block waiting to begin a
  120.    render interval.  A return value of 1 indicates success, 0 indicates
  121.    failure. */
  122. extern int glrBeginRenderInterval (GLrCanvas canvas, int width, int height, int timeout, int wait);
  123.  
  124. /* glrQueryRenderIntervalStatus - checks if the current render interval is
  125.    expired.  A return value of 1 indicates the render interval is not
  126.    expired.  A return value of 0 indicates the render interval has been
  127.    expired. */
  128. extern int glrQueryRenderIntervalStatus (GLrCanvas canvas);
  129.  
  130. /* glrResumeRenderInterval - "makes current" back to a canvas within a
  131.    rendering interval.  This can be used if some other API routine (like
  132.    GLX's glXMakeCurrent) changes the thread's OpenGL window/context binding.
  133.    You should not attempt to "make current" to another GLR context from the
  134.    same server since deadlock may result (though the deadlock should
  135.    eventually timeout).  A return value of 1 indicates success, 0 indicates
  136.    failure. */
  137. extern int glrResumeRenderInterval (GLrCanvas canvas);
  138.  
  139. /* glrEndRenderInterval - completes a rendering interval.  A return value of
  140.    1 indicates  the rendering interval completed without any invalidation of
  141.    the frame buffer. Any and all frame buffer results read back during the
  142.    render interval are valid.  0 indicates the render interval was aborted
  143.    before the interval was completed, meaning frame buffer results are likely 
  144.    to be undefined.  The duration pointer (if not NULL) returns the amount of 
  145.    time in milliseconds during the render interval to form improved estimates 
  146.    on the needed render interval timeout. */
  147. extern int glrEndRenderInterval (GLrCanvas canvas, int *duration);
  148.  
  149. /* glrQueryQueueLength - return estimate of how many milliseconds of work
  150.    is pending on the render interval queue associated with the specified
  151.    canvas. */
  152. extern int glrQueryQueueLength (GLrCanvas canvas, int *pending);
  153.  
  154. #ifdef __cplusplus
  155. }
  156. #endif
  157.  
  158. #endif /* __glr_h__ */
  159.